﻿using System.Collections.Generic;
using Cureos.Measures;
using Cureos.Measures.Quantities;

namespace SensorDrone.Net
{
    /// <summary>
    /// A reading from a sensor
    /// </summary>
    public class Reading
    {
        public Reading()
        {
            Measure = new Measure<Number>();
            AlternateUnits = new List<IUnit>();
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">The sensor providing the reading</param>
        /// <param name="unit">The unit of the reading</param>
        /// <param name="reading">The sample from the sensor</param>
        public Reading(string name,string unit, string reading):this()
        {
            Name = name;
            Unit = unit;
            Value = reading;
            
        }
        
        /// <summary>
        /// Reading provides a SI value
        /// </summary>
        public IMeasure Measure { get; set; }
        /// <summary>
        /// Possible units the measurement can be displayed in
        /// </summary>
        public IEnumerable<IUnit> AlternateUnits { get; set; }
        /// <summary>
        /// The name of the sensor
        /// </summary>
        public string Name { get; private set; }
        /// <summary>
        /// The unit of measure
        /// </summary>
        public string Unit { get; private set; }
        /// <summary>
        /// The sample as a string
        /// </summary>
        public string Value { get; private set; }
    }
}
